import Vue from 'vue'
import Router from 'vue-router'
import store from '../vuex/store'
import config from './config'

Vue.use(Router)

import IndexView from '../views/IndexView.vue'
import SystemView from '../views/SystemView.vue'
import SystemUserView from '../views/SystemUserView.vue'
import SystemProductConfigView from '../views/SystemProductConfigView.vue'
import SystemRiskConfigView from '../views/SystemRiskConfigView.vue'
import SystemIcloudShowView from '../views/SystemIcloudShowView.vue'
import SystemAppConfigView from '../views/SystemAppConfigView.vue'
import SystemRepayConfigView from '../views/SystemRepayConfigView.vue'

import IcloudView from '../views/IcloudView.vue'
import IcloudIndexView from '../views/IcloudIndexView.vue'
import IcloudDetailView from '../views/IcloudDetailView.vue'

import AfterLoanView from '../views/AfterLoanView.vue'
import AfterLoanWaitView from '../views/AfterLoanWaitView.vue'
import AfterLoanAllotView from '../views/AfterLoanAllotView.vue'
import AfterLoanAllotIndexView from '../views/AfterLoanAllotIndexView.vue'
import AfterLoanHistoryView from '../views/AfterLoanHistoryView.vue'
import AfterLoanErrorView from '../views/AfterLoanErrorView.vue'
import AfterLoanDetailView from '../views/AfterLoanDetailView.vue'
import afterLoanReturnView from '../views/afterLoanReturnView.vue'
import LoginView from '../views/LoginView.vue'

import AuthApplyView from '../views/AuthApplyView.vue'
import AuthApplyWaitView from '../views/AuthApplyWaitView.vue'
import AuthApplyHistoryView from '../views/AuthApplyHistoryView.vue'
import AuthApplyHistoryDetailView from '../views/AuthApplyHistoryDetailView.vue'
import AuthApplyDetailView from '../views/AuthApplyDetailView.vue'

import LoanApplyView from '../views/LoanApplyView.vue'
import LoanApplyWaitView from '../views/LoanApplyWaitView.vue'
import LoanApplyHistoryView from '../views/LoanApplyHistoryView.vue'
import LoanApplyDetailView from '../views/LoanApplyDetailView.vue'
import LoanFailureView from '../views/LoanFailureView.vue'

import FinanceView from '../views/FinanceView.vue'
import FinanceDetailView from '../views/FinanceDetailView.vue'
import FinanceWaitView from '../views/FinanceWaitView.vue'
import FinanceRejectView from '../views/FinanceRejectView.vue'
import FinanceInView from '../views/FinanceInView.vue'
import FinanceOutView from '../views/FinanceOutView.vue'
import FinanceIngView from '../views/FinanceIngView.vue'
import FinanceExtendView from '../views/FinanceExtendView.vue'

import OperateView from '../views/OperateView.vue'
import EveryStatisticsView from '../views/EveryStatisticsView.vue'


import UserView from '../views/UserView.vue'
import UserIndexView from '../views/UserIndexView.vue'
import UserDetailView from '../views/UserDetailView.vue'
import DailyView from '../views/DailyView.vue'
import DailyIndexView from '../views/DailyIndexView.vue'
import ReportView from '../views/ReportView.vue'
import ReportIndexView from '../views/ReportIndexView.vue'
import MoneyView from '../views/MoneyView.vue'
import MoneyIndexView from '../views/MoneyIndexView.vue'
import OrderView from '../views/OrderView.vue'
import OrderIndexView from '../views/OrderIndexView.vue'
import OrderDetailView from '../views/OrderDetailView.vue'
import TransactionView from '../views/TransactionView.vue'
import TransactionAnalysisView from '../views/TransactionAnalysisView.vue'
import TransactionDetailView from '../views/TransactionDetailView.vue'
import LoanView from '../views/LoanView.vue'
import LoanIndexView from '../views/LoanIndexView.vue'
import LoanAppView from '../views/LoanAppView.vue'
import LoanAddProductView from '../views/LoanAddProductView.vue'
import PushMessageView from '../views/PushMessageView.vue'
import PushMessageIndexView from '../views/PushMessageIndexView.vue'
import QRView from '../views/QRView.vue'
import QRIndexView from '../views/QRIndexView.vue'
import IOUView from '../views/IOUView.vue'
import IOUIndexView from '../views/IOUIndexView.vue'


import dashBoardView from '../views/dashBoard.vue'
import financialBodyView from '../views/financialBodyView.vue'
import financialView from '../views/financialView.vue'
import receiptView from '../views/receiptView.vue'
/*渠道管理*/
import ChannelManagementView from '../views/ChannelManagementView.vue'
import ChannelInquiryView from '../views/ChannelInquiryView.vue'
import ChannelView from '../views/ChannelView.vue'

//客户管理
import staffView from '../views/staffView.vue'
import staffManagementView from '../views/staffManagementView.vue'
import custInfoView from '../views/CustInfoView.vue'
import BlacklistView from '../views/BlacklistView.vue'

//风控管理
import ControlManagementView from '../views/ControlManagementView.vue'
import CustomerQuotaView from '../views/CustomerQuotaView.vue'

import channelStatisticsView from '../views/ChannelStatisticsView.vue'
import commonConfigView from '../views/commonConfigView.vue'
import OverdueStatisticsView from '../views/OverdueStatisticsView.vue'
let router = new Router({
    routes: [{
        path: '/',
        name: 'default',
        component: IndexView
    },{
        path: '/index',
        name: 'index',
        component: IndexView,
        children: [{
            path: '/user',
            name: 'user',
            component: UserView,
            children:[{
                path: '/user-index',
                name: 'user-index',
                component: UserIndexView
            },{
                path: '/user-detail/:id',
                name: 'user-detail',
                component: UserDetailView
            }]
        },
        ,{
            path: '/operate',
            name: 'operate',
            component: OperateView,
            children:[{
                path: '/every-statistics',
                name: 'every-statistics',
                component: EveryStatisticsView,
            }]
        },
        {
            path:"/dash-board",
            name:"dash-board",
            component:dashBoardView,
        },
        {
            path:"/control-management",
            name:"control-management",
            component:ControlManagementView,
            children:[{
                path: '/customer-quota',
                name: 'customer-quota',
                component: CustomerQuotaView,
            }]
        },
        /*{
            path:"/channel-inquiry",
            name:"channel-inquiry",
            component:ChannelInquiryView,
        },*/
        {
            path: '/staff',
            name: 'staff',
            component: staffView,
            children:[{
                path: '/staff-management',
                name: 'staff-management',
                component: staffManagementView
            },
            {
                path: '/cust-info',
                name: 'cust-info',
                component: custInfoView
            },{
                path: '/black-list',
                name: 'black-list',
                component: BlacklistView
            }]
        },
        {
            path: '/channel',
            name: 'channel',
            component: ChannelView,
            children:[{
                path: '/channel-management',
                name: 'channel-management',
                component: ChannelManagementView
            },{
                path: '/channel-inquiry',
                name: 'channel-inquiry',
                component: ChannelInquiryView
            }]
        },
        {
            path:"/financial-body",
            name:"financial-body",
            component:financialBodyView,
            children:[{
                path: '/financial',
                name: 'financial',
                component: financialView
            },{
                path: '/channel-statistics',
                name: 'channel-statistics',
                component: channelStatisticsView
            },,{
                path: '/overdue-statistics',
                name: 'overdue-statistics',
                component: OverdueStatisticsView
            }]

        },
        {
            path:"/receipt",
            name:"receipt",
            component:receiptView,
        },{
            path: '/system',
            name: 'system',
            component: SystemView,
            children:[{
                path: '/system-user',
                name: 'system-user',
                component: SystemUserView
            },{
                path: '/common-config',
                name: 'common-config',
                component: commonConfigView
            },{
                path: '/system-risk-config',
                name: 'system-risk-config',
                component: SystemRiskConfigView
            },{
                path: '/system-icloud-show',
                name: 'system-icloud-show',
                component: SystemIcloudShowView
            }/*,{
                path: '/system-app-config',
                name: 'system-app-config',
                component: SystemAppConfigView
            }*/,{
                path: '/system-repay-config',
                name: 'system-repay-config',
                component: SystemRepayConfigView
            }]
        },{
            path: '/auth-apply',
            name: 'auth-apply',
            component: AuthApplyView,
            children:[/*{
                path: '/auth-apply-wait',
                name: 'auth-apply-wait',
                component: AuthApplyWaitView
            },*/{
                path: '/auth-apply-history',
                name: 'auth-apply-history',
                component: AuthApplyHistoryView
            },{
                path: '/auth-apply-detail/:id',
                name: 'auth-apply-detail',
                component: AuthApplyDetailView
            },{
                path: '/auth-apply-history-detail/:id',
                name: 'auth-apply-history-detail',
                component: AuthApplyHistoryDetailView  //AuthApplyHistoryDetailView
            }]
        },{
            path: '/loan-apply',
            name: 'loan-apply',
            component: LoanApplyView,
            children:[{
                path: '/loan-apply-wait',
                name: 'loan-apply-wait',
                component: LoanApplyWaitView
            },{
                path: '/loan-apply-history',
                name: 'loan-apply-history',
                component: LoanApplyHistoryView
            },{
                path: '/loan-apply-detail/:id',
                name: 'loan-apply-detail',
                component: LoanApplyDetailView
            }]
        },{
            path: '/daily',
            name: 'daily',
            component: DailyView,
            children:[{
                path: '/daily-index',
                name: 'daily-index',
                component: DailyIndexView
            }]
        },{
            path: '/push-message',
            name: 'push-message',
            component: PushMessageView,
            children:[{
                path: '/push-message-index',
                name: 'push-message-index',
                component: PushMessageIndexView
            }]
        },{
            path: '/report',
            name: 'report',
            component: ReportView,
            children:[{
                path: '/report-index',
                name: 'report-index',
                component: ReportIndexView
            }]
        },{
            path: '/money',
            name: 'money',
            component: MoneyView,
            children:[{
                path: '/money-index',
                name: 'money-index',
                component: MoneyIndexView
            },]
        },{
            path: '/order',
            name: 'order',
            component: OrderView,
            children:[{
                path: '/order-index',
                name: 'order-index',
                component: OrderIndexView
            },{
                path: '/order-detail/:id',
                name: 'order-detail',
                component: OrderDetailView
            }]
        },{
            path: '/transaction',
            name: 'transaction',
            component: TransactionView,
            children:[{
                path: '/transaction-analysis',
                name: 'transaction-analysis',
                component: TransactionAnalysisView
            },{
                path: '/transaction-detail/:id',
                name: 'transaction-detail',
                component: TransactionDetailView
            }]
        },{
            path: '/qr',
            name: 'qr',
            component: QRView,
            children:[{
                path: '/qr-index',
                name: 'qr-index',
                component: QRIndexView
            }]
        },{
            path: '/IOU',
            name: 'IOU',
            component: IOUView,
            children:[{
                path: '/IOU-index',
                name: 'IOU-index',
                component: IOUIndexView
            }]
        },{
            path: '/loan',
            name: 'loan',
            component: LoanView,
            children:[{
                path: '/loan-index',
                name: 'loan-index',
                component: LoanIndexView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/loan-app',
                name: 'loan-app',
                component: LoanAppView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/loan-add-product',
                name: 'loan-add-product',
                component: LoanAddProductView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/loan-edit-product/:id',
                name: 'loan-edit-product',
                component: LoanAddProductView,
                meta: {
                    keepAlive: false
                }
            }]
        },{
            path: '/finance',
            name: 'finance',
            component: FinanceView,
            children:[{
                path: '/finance-wait',
                name: 'finance-wait',
                component: FinanceWaitView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/finance-reject',
                name: 'finance-reject',
                component: FinanceRejectView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/finance-ing',
                name: 'finance-ing',
                component: FinanceIngView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/finance-extend',
                name: 'finance-extend',
                component: FinanceExtendView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/finance-detail/:id',
                name: 'finance-detail',
                component: FinanceDetailView,
            },{
                path: '/finance-in',
                name: 'finance-in',
                component: FinanceInView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/finance-out',
                name: 'finance-out',
                component: FinanceOutView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/loan_failure',
                name: 'loan_failure',
                component: LoanFailureView,
                meta: {
                    keepAlive: false
                }
            }]
        },{
            path: '/icloud',
            name: 'icloud',
            component: IcloudView,
            children:[{
                path: '/icloud-index',
                name: 'icloud-index',
                component: IcloudIndexView,
            },{
                path: '/icloud-detail/:id',
                name: 'icloud-detail',
                component: IcloudDetailView,
            }]
        },{
            path: '/after-loan',
            name: 'after-loan',
            component: AfterLoanView,
            children:[{
                path: '/after-loan-wait',
                name: 'after-loan-wait',
                component: AfterLoanWaitView,
            },{
                path: '/after-loan-history',
                name: 'after-loan-history',
                component: AfterLoanHistoryView,
            },
            {
                path: '/after-loan-allot-index',
                name: 'after-loan-allot-index',
                component: AfterLoanAllotIndexView,
                meta: {
                    keepAlive: false
                }
            },
            {
                path: '/after-loan-return',
                name: 'after-loan-return',
                component: afterLoanReturnView,
                meta: {
                    keepAlive: false
                }
            },{
                path: '/after-loan-detail/:id',
                name: 'after-loan-detail',
                component: AfterLoanDetailView,
            },]
        },{
            path: '/after-loan-allot',
            name: 'after-loan-allot',
            component: AfterLoanAllotView,
            meta: {
                keepAlive: false
            },
            children:[/*{
                path: '/after-loan-allot-index',
                name: 'after-loan-allot-index',
                component: AfterLoanAllotIndexView,
                meta: {
                    keepAlive: false
                }
            }*/
           /* {   path:'/after-loan-wait',
                name:'after-loan-wait',                   
                component: AfterLoanWaitView,
                
            },{ path:'/after-loan-history',
                name:'after-loan-history',                   
                component: AfterLoanHistoryView,
                
            }*/]
        }]
    },{
        path: '/login', name: 'login', component: LoginView
    },{
        path: '*', redirect: '/index'
    }]
})

new config(router).render()

export default router
